package com.zrentech.order.adapter;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.ImageView;

public class FoodGridAdapter extends FoodAdapter {
	
	int mAlbumSize;

	public FoodGridAdapter(Activity context) {
		super(context);
		//mAlbumSize = (int)context.getResources().getDimension(R.dimen.album_size); 
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ImageView i;

         if (convertView == null) {
             i = new ImageView(mContext);
             i.setScaleType(ImageView.ScaleType.FIT_CENTER);
             i.setLayoutParams(new GridView.LayoutParams(mAlbumSize, mAlbumSize));
         } else {
             i = (ImageView) convertView;
         }

         /*i.setDefaultImage(R.drawable.no_cd_125);
         i.setImageUrl(mList.get(position).getImage());*/

         return i;
	}
	
	/**
	 * Class implementing holder pattern,
	 * performance boost
	 * 
	 * @author Lukasz Wisniewski
	 */
	static class ViewHolder {
		ImageView image;
	}
}
